﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TMD.GT.Entidades;
using TMD.GT.AccesoDatos.Map;
using TMD.GT.AccesoDatos.Contrato;
using TMD.GT.AccesoDatos.Core;
using System.Data.Common;
using System.Data;



namespace TMD.GT.AccesoDatos.Implementacion
{
    public class ImpactoData : DataBase, IImpactoData
    {

        public ImpactoData(String connectionString)
            : base(connectionString)
        {
        }

        public List<Impacto> ListarImpacto()
        {
            List<Impacto> listaImpacto = new List<Impacto>();

            using (DbCommand command = DB.GetStoredProcCommand("dbo.USP_IMPACTO_SEL"))
            {
                using (IDataReader reader = DB.ExecuteReader(command))
                {
                    while (reader.Read())
                    {
                        listaImpacto.Add(ImpactoMap.Select(reader));
                    }
                }
            }

            return listaImpacto;
        }






    }
}
